import requests
import json

# upload file
# url = 'http://180.184.72.207:37025/xdport/19666/api/ccnet_uploadfile'
# data = {}
# files = {'file':('test.jpg', open('test.jpg', 'rb'))
#          }
# r = requests.post(url, files=files)
# print(r.text)

# inference
url = 'http://180.184.72.207:37025/xdport/19666/api/ccnet'
data = {"content":"ok"}
files = {'file':('test.jpg', open('test.jpg', 'rb'))
         }
r = requests.post(url, data=json.dumps(data))
print(r.text)

# get segmentation map 
# 直接使用浏览器打开下面网址即可下载文件
# url = 'http://180.184.72.207:37025/xdport/19666/api/ccnet_downloadfile'

